package com.baosight.sczx.zm.cl.service;

import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.ep.ServiceEPBase;
import com.baosight.sczx.common.zm.basetools.StaticTools;
import com.baosight.sczx.zm.cl.domain.ZMCLRiskHandleProcess_x;

/**
 * 隐患处理过程
 * 隐患处理\整改\复查 记录
 * <p>Title: ServiceZMCL71.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 严洪浩
 * @version 1.0
 * <pre>Histroy:
 *          2011-8-5 下午01:39:06  严洪浩  Create
 *</pre>
 */
public class ServiceZMCL71 extends ServiceEPBase {
	
	/**
	 * 初始化
	 * <p>Function: initLoad</p>
	 * <p>Description: </p>
	 * <p>return value: ServiceZMCL71</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-8-5下午01:39:54 严洪浩
	 * </p>
	 *
	 */
	@Override
	public EiInfo initLoad(EiInfo inInfo) {
		inInfo.addBlock(EiConstant.resultBlock).set("showCount", "true");//如果不加这个，翻页的统计和显示是错误的
		EiInfo outInfo = this.query(inInfo);
		
		return outInfo;
	}
	
	/**
	 * 查询
	 * <p>Function: query</p>
	 * <p>Description: </p>
	 * <p>return value: ServiceZMCL70</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2011-8-5上午07:51:16 严洪浩
	 * </p>
	 *
	 */
	@Override
	public EiInfo query(EiInfo inInfo) {
		StaticTools.setQueryParameters(inInfo, "fdRiskRecordId", inInfo.getString("fdRiskRecordId"), true);//隐患记录ID
		inInfo.addBlock(EiConstant.resultBlock).set(EiConstant.offsetStr, 0);
		inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.limitStr, 100);
		inInfo.getBlock(EiConstant.resultBlock).set(EiConstant.isCountFlag, true);
		EiInfo outInfo = super.query(inInfo, "ZMCLRiskHandleProcess_x.query", new ZMCLRiskHandleProcess_x());
		
		return outInfo;
	}
}
